# --coding:utf-8--
# MakeBy: LiuBoyuan
from entiys.methods.augument.SaveAttribute import SaveAttribute


class Buff:
    def __init__(self, saveAttribute: SaveAttribute):
        self.saveAttribute = saveAttribute
        self.buffName = ""

    def flagActive(self, charaName) -> bool:
        """
        该效果是否激活
        【默认是查看当前角色的表中是否存在效果】
        :return:
        """

        npc = self.saveAttribute.npc()
        chara = npc.getByName(charaName)
        buffString : str = chara.get("效果")
        lstBuffs = buffString.split(",")
        return self.buffName in lstBuffs


    def buffEffect(self) -> bool:
        """
        效果对属性的作用
        :return:
        """